<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */
namespace app\command;

use app\enum\CommandEnum;
use app\enum\CommonEnum;
use app\enum\QqEnum;
use app\model\ClientAccountModel;
use app\model\ClientAccountOperationModel;
use app\model\ProjectAccountModel;
use app\model\QqAdvertiserHourlyReportExtModel;
use app\model\QqAdvertiserHourlyReportModel;
use app\service\client\AccountService;
use app\service\qq\FinanceService;
use think\console\Input;
use think\console\Output;
use think\facade\Cache;
use think\facade\Db;

class QqAdvertiserHourlyReportWork extends BaseWork
{
    public const REDIS_TASK_KEY = CommandEnum::QQ_TASK_LIST_KEY[1];

    public array $clientAccountInfo = [];

    protected function configure()
    {
        // 指令配置
        $this->setName('qq_advertiser_hourly_report_work');
        // 设置参数
        $this->setDescription('拉取广点通广告主消耗小时报表脚本');

        // 设置参数
        $this->addArgument('type', null, '方式')    // 天
            ->setHelp('php think qq_advertiser_hourly_report_work [type]');
    }

    protected function execute(Input $input, Output $output)
    {
        set_time_limit(0);
        $output->writeln('=======广点通-账户报表拉取开始' . date('Y-m-d H:i:s', time()) . '=======');
        $type = $input->getArgument('type');
        $redisKey = self::REDIS_TASK_KEY;
        if ($type == 2) {
            $date = date('Y-m-d', strtotime('-1 day'));
        } else {
            $date = date('Y-m-d');
        }
        $redis = Cache::store('redis')->handler();
        $count = 0;
        while (true) {
            if ($count >= 1) {
                break;
            }
            $advertiserId = $redis->lPop($redisKey);
            if ($advertiserId) {
                // 请求接口
                $this->clientAccountInfo = $this->_getClientAccountInfo($advertiserId);
                $page = 0;
                while (true) {
                    $token = AccountService::getToken(CommonEnum::QQ_MEDIA, $advertiserId);
                    if (! $token) {
                        break;
                    }
                    ++$page;
                    $result = $this->_getServiceAdvertiserHourlyReport($token, $advertiserId, $date, $date, $page);
                    if (! $result) {
                        $err = ['params' => ['token' => $token, 'advertiserId' => $advertiserId, 'startDate' => $date, 'endDate' => $date, 'page' => $page], 'response' => FinanceService::getError(0)];
                        $output->writeln('=======error:' . json_encode($err, JSON_UNESCAPED_UNICODE) . '=======' . PHP_EOL);
                        logss($this->getDescription(), $this->getName(), $err);
                        break;
                    }
                    if (! isset($result['data'])) {
                        break;
                    }
                    $list = $result['data']['list'];
                    if (count($list) == 0) {
                        break;
                    }
                    foreach ($list as $v) {
                        $v['cost'] = $v['cost'] / 100;  // 单位分
                        $v['date'] = $date;
                        $v['hour'] = $v['hour'] >= 10 ? $v['hour'] : '0' . $v['hour'];
                        $statDate = intval(date('Ymd', strtotime($date)));
                        $statDatetime = intval($statDate . $v['hour']);
                        $statInfo = $this->_getStatInfo($advertiserId, $statDate, $statDatetime);
                        if (! empty($statInfo)) {
                            if (! $this->_isReportDataUpdate($statInfo, $v)) {
                                $this->_updateAdvertiserData($statInfo['id'], $v);
                            }
                        } else {
                            $this->_insertAdvertiserData($advertiserId, $v);
                        }
                    }
                }
                ++$count;
            } else {
                break;
            }
        }
        $output->writeln('=======广点通-账户报表拉取结束' . date('Y-m-d H:i:s', time()) . '=======');
    }

    private function _getServiceAdvertiserHourlyReport(string $token = '', string $advertiserId = '', string $startDate = '', string $endDate = '', int $page = 1)
    {
        $timestamp = time();
        $params = [
            'access_token' => $token,
            'account_id' => $advertiserId,
            'date_range' => [
                'start_date' => $startDate,
                'end_date' => $endDate,
            ],
            'level' => QqEnum::REPORT_LEVEL_ADVERTISER,
            'fields' => $this->_getFields(),
            'page' => $page,
            'page_size' => QqEnum::ADVERTISER_MAX_PAGE_SIZE,
        ];
        return FinanceService::_getServiceHourlyReport($params);
    }

    /**
     * 判断是否需要更新.
     * @param array $oldData 旧数据
     * @param array $newData 新数据
     */
    private function _isReportDataUpdate(array $oldData = [], array $newData = []): bool
    {
        $one = $oldData['cost'] == $newData['cost'];

        if ($one) {
            return true;
        }

        return false;
    }

    /**
     * 获取广告账户报表信息.
     * @param string $advertiserId 账户ID
     * @param int $statDate 日期
     * @throws
     */
    private function _getStatInfo(string $advertiserId = '', int $statDate = 0, int $statDatetime = 0): array
    {
        $where = [
            ['stat_date', '=', $statDate],
            ['stat_datetime', '=', $statDatetime],
            ['advertiser_id', '=', $advertiserId],
        ];

        $info = (new QqAdvertiserHourlyReportModel())->where($where)->field(true)->find();
        if (! $info) {
            return [];
        }

        return $info->toArray();
    }

    /**
     * 修改广告报表信息.
     * @param int $id 主键ID
     * @param array $info 信息数据
     */
    private function _updateAdvertiserData(int $id = 0, array $info = []): bool
    {
        try {
            if (! isset($info['photo_signature'])) {
                return false;
            }

            $data = [
                'cost' => $info['cost'],
                'update_time' => time(),
            ];

            $extData = [
                'content' => json_encode($info, JSON_UNESCAPED_UNICODE),
                'update_time' => time(),
            ];

            Db::startTrans();
            $one = (new QqAdvertiserHourlyReportModel())->where('id', $id)->update($data);
            $two = (new QqAdvertiserHourlyReportExtModel())->where('report_id', $id)->update($extData);
            if ($one && $two) {
                Db::commit();
                return true;
            }

            Db::rollback();
            return false;
        } catch (\Exception $e) {
            return self::setError($e->getMessage());
        }
    }

    /**
     * 插入广告报表信息.
     * @param string $advertiserId 账户ID
     * @param array $info 信息数据
     */
    private function _insertAdvertiserData(string $advertiserId = '', array $info = []): bool
    {
        try {
            Db::startTrans();
            $statDate = date('Ymd', strtotime($info['date']));
            $statDatetime = $statDate . $info['hour'];
            $data = [
                'company_id' => $this->clientAccountInfo['company_id'],
                'client_id' => $this->clientAccountInfo['client_id'],
                'advertiser_id' => $advertiserId,
                'account_id' => $this->clientAccountInfo['id'],
                'project_id' => $this->clientAccountInfo['project_id'],
                'staff_id' => $this->clientAccountInfo['staff_id'],
                'stat_date' => $statDate,
                'stat_datetime' => $statDatetime,
                'cost' => $info['cost'],
                'create_time' => time(),
            ];
            $insertId = (new QqAdvertiserHourlyReportModel())->insertGetId($data);

            if ($insertId <= 0) {
                Db::rollback();
                return false;
            }

            $extData = [
                'company_id' => $this->clientAccountInfo['company_id'],
                'client_id' => $this->clientAccountInfo['client_id'],
                'account_id' => $this->clientAccountInfo['id'],
                'report_id' => $insertId,
                'advertiser_id' => $advertiserId,
                'stat_date' => $statDate,
                'stat_datetime' => $statDatetime,
                'content' => json_encode($info, JSON_UNESCAPED_UNICODE),
                'create_time' => time(),
            ];

            $extInsertId = (new QqAdvertiserHourlyReportExtModel())->insertGetId($extData);

            if ($extInsertId <= 0) {
                Db::rollback();
                return false;
            }

            Db::commit();
            return true;
        } catch (\Exception $e) {
            return self::setError($e->getMessage());
        }
    }

    /**
     * 获取账户信息.
     * @param string $advertiserId 账户ID
     * @throws
     */
    private function _getClientAccountInfo(string $advertiserId = ''): array
    {
        $info = (new ClientAccountModel())->where('advertiser_id', $advertiserId)->field(true)->find();
        if (! $info) {
            return [];
        }
        $info = $info->toArray();
        // 查询账户运营
        $staffId = ClientAccountOperationModel::where('advertiser_id', $advertiserId)->value('staff_id');
        $projectId = ProjectAccountModel::where('account_id', $info['id'])->value('project_id');
        $info['staff_id'] = $staffId ?: 0;
        $info['project_id'] = $projectId ?: 0;
        return $info;
    }

    /**
     * 获取字段.
     * @return string[]
     */
    private function _getFields(): array
    {
        return [
            'material_id',
            'account_id',
            'date',
            'view_count',
            'download_count',
            'activated_count',
            'activated_rate',
            'thousand_display_price',
            'valid_click_count',
            'ctr',
            'cpc',
            'cost',
            'key_page_view_cost',
            'coupon_click_count',
            'coupon_issue_count',
            'coupon_get_count',
            'platform_page_view_count',
            'platform_page_view_rate',
            'web_commodity_page_view_count',
            'web_commodity_page_view_cost',
            'web_register_count',
            'page_consult_count',
            'page_consult_cost',
            'page_phone_call_direct_count',
            'page_phone_call_direct_cost',
            'page_phone_call_back_count',
            'page_phone_call_back_cost',
            'own_page_navigation_count',
            'own_page_navi_cost',
            'platform_page_navigation_count',
            'platform_page_navigation_cost',
            'platform_shop_navigation_count',
            'platform_shop_navigation_cost',
            'web_application_count',
            'web_application_cost',
            'page_reservation_count',
            'page_reservation_by_display_count',
            'page_reservation_by_click_count',
            'page_reservation_rate',
            'page_reservation_cost',
            'page_reservation_cost_with_people',
            'web_add_to_cart_count',
            'web_add_to_cart_cost',
            'add_to_cart_price',
            'own_page_coupon_get_count',
            'own_page_coupon_get_cost',
            'platform_coupon_get_count',
            'platform_coupon_get_cost',
            'web_order_count',
            'order_by_display_count',
            'order_by_click_count',
            'web_order_rate',
            'order_by_display_rate',
            'order_by_click_rate',
            'app_order_rate',
            'web_order_cost',
            'order_by_display_cost',
            'order_by_click_cost',
            'web_checkout_amount',
            'web_checkout_count',
            'web_checkout_cost',
            'order_amount',
            'order_by_display_amount',
            'order_by_click_amount',
            'order_unit_price',
            'order_roi',
            'order_by_display_roi',
            'order_by_click_roi',
            'deliver_count',
            'deliver_cost',
            'sign_in_count',
            'sign_in_cost',
            'download_rate',
            'download_cost',
            'install_count',
            'install_cost',
            'click_activated_rate',
            'activated_cost',
            'retention_count',
            'retention_rate',
            'app_retention_d3_rate',
            'app_retention_d5_rate',
            'app_retention_d7_rate',
            'app_key_page_retention_rate',
            'retention_cost',
            'key_page_view_count',
            'key_page_view_by_display_count',
            'key_page_view_by_click_count',
            'app_commodity_page_view_count',
            'app_commodity_page_view_by_display_count',
            'app_commodity_page_view_by_click_count',
            'app_commodity_page_view_rate',
            'web_commodity_page_view_rate',
            'app_commodity_page_view_cost',
            'app_register_count',
            'register_by_display_count',
            'register_by_click_count',
            'app_register_cost',
            'web_register_cost',
            'app_application_count',
            'app_application_cost',
            'app_add_to_cart_count',
            'add_to_cart_amount',
            'app_add_to_cart_cost',
            'app_order_count',
            'app_order_cost',
            'app_checkout_count',
            'app_checkout_by_display_count',
            'app_checkout_by_click_count',
            'app_checkout_amount',
            'app_checkout_cost',
            'platform_coupon_click_count',
            'platform_coupon_get_rate',
            'coupon_usage_number',
            'coupon_usage_cost',
            'coupon_usage_rate',
            'coupon_purchase_rate',
            'follow_count',
            'follow_cost',
            'forward_count',
            'forward_cost',
            'read_count',
            'read_cost',
            'praise_count',
            'praise_cost',
            'comment_count',
            'comment_cost',
            'inte_phone_count',
            'phone_call_count',
            'external_form_reservation_count',
            'app_ad_paying_users',
            'ad_pur_val_web',
            'ad_pur_val_app',
            'order_24h_count',
            'order_24h_by_display_count',
            'order_24h_by_click_count',
            'order_24h_rate',
            'order_24h_cost',
            'order_24h_amount',
            'order_24h_by_display_amount',
            'order_24h_by_click_amount',
            'order_24h_roi',
            'order_24h_by_display_roi',
            'order_24h_by_click_roi',
            'game_create_role_count',
            'game_authorize_count',
            'game_tutorial_finish_count',
            'effective_leads_count',
            'effective_cost',
            'effective_reserve_count',
            'effective_consult_count',
            'effective_phone_count',
            'potential_reserve_count',
            'potential_consult_count',
            'potential_phone_count',
            'app_checkout_rate',
            'web_checkout_rate',
            'app_activated_checkout_rate',
            'web_activated_checkout_rate',
            'app_register_rate',
            'web_reg_rate',
            'page_phone_call_direct_rate',
            'page_phone_call_back_rate',
            'page_consult_rate',
            'deliver_rate',
            'install_rate',
            'arppu_cost',
            'arpu_cost',
            'web_arppu_cost',
            'web_arpu_cost',
            'app_ad_pur_arpu_cost',
            'app_ad_pur_arppu_cost',
            'web_ad_pur_arpu_cost',
            'cheout_fd',
            'cheout_td',
            'cheout_ow',
            'cheout_tw',
            'cheout_om',
            'cheout_fd_reward',
            'cheout_td_reward',
            'cheout_ow_reward',
            'cheout_tw_reward',
            'cheout_om_reward',
            'cheout_total_reward',
            'from_follow_uv',
            'from_follow_by_display_uv',
            'from_follow_by_click_uv',
            'from_follow_cost',
            'from_follow_by_display_cost',
            'from_follow_by_click_cost',
            'add_desktop_pv',
            'add_desktop_cost',
            'first_pay_count',
            'wechat_local_pay_count',
            'wechat_local_payuser_count',
            'wechat_local_pay_amount',
            'wechat_local_pay_roi',
            'first_pay_rate',
            'pre_cre_web',
            'pre_cre_app',
            'pre_cre_web_val',
            'pre_cre_app_val',
            'cre_web',
            'cre_app',
            'cre_web_val',
            'cre_app_val',
            'withdr_dep_web',
            'withdr_dep_app',
            'withdr_dep_web_val',
            'withdr_dep_app_val',
            'first_pay_cost',
            'landing_page_click_count',
            'web_cart_amount',
            'scan_follow_count',
            'scan_follow_user_count',
            'scan_follow_user_cost',
            'scan_follow_user_rate',
            'app_order_amount',
            'web_order_amount',
            'phone_consult_count',
            'tool_consult_count',
            'lottery_leads_count',
            'lottery_leads_cost',
            'conversions_count',
            'conversions_by_click_count',
            'conversions_by_display_count',
            'conversions_rate',
            'conversions_by_display_rate',
            'conversions_by_click_rate',
            'conversions_cost',
            'conversions_by_display_cost',
            'conversions_by_click_cost',
            'deep_conversions_count',
            'deep_conversions_rate',
            'deep_conversions_cost',
            'first_memcard_web_count',
            'first_memcard_app_count',
            'memcard_web_count',
            'memcard_app_count',
            'first_memcard_web_rate',
            'first_memcard_app_rate',
            'first_memcard_web_cost',
            'first_memcard_app_cost',
            'valuable_click_count',
            'valuable_click_rate',
            'valuable_click_cost',
            'video_play_count',
            'click_image_count',
            'click_detail_count',
            'click_head_count',
            'click_nick_count',
            'click_poi_count',
            'video_inner_play_count',
            'lan_button_click_count',
            'lan_jump_button_clickers',
            'lan_jump_button_click_cost',
            'lan_jump_button_ctr',
            'lan_button_click_cost',
            'cpn_click_button_count',
            'cpn_click_button_uv',
            'key_page_uv',
            'special_page_exp_uv',
            'special_page_exp_cost',
            'view_commodity_page_uv',
            'effect_leads_purchase_count',
            'reservation_uv',
            'overall_leads_purchase_count',
            'leads_purchase_count',
            'leads_purchase_rate',
            'leads_purchase_cost',
            'leads_purchase_uv',
            'valid_leads_uv',
            'phone_call_uv',
            'valid_phone_uv',
            'potential_customer_phone_uv',
            'web_register_uv',
            'web_apply_uv',
            'web_credit_uv',
            'app_apply_uv',
            'app_pre_credit_uv',
            'app_credit_uv',
            'app_withdraw_uv',
            'wechat_app_register_uv',
            'no_interest_count',
            'first_day_order_count',
            'first_day_order_by_display_count',
            'first_day_order_by_click_count',
            'first_day_order_amount',
            'first_day_order_by_display_amount',
            'first_day_order_by_click_amount',
            'add_wishlist_count',
            'video_outer_play10_count',
            'video_outer_play25_count',
            'video_outer_play50_count',
            'video_outer_play75_count',
            'video_outer_play90_count',
            'video_outer_play95_count',
            'video_outer_play100_count',
            'video_outer_play_time_count',
            'video_outer_play_time_avg_rate',
            'video_outer_play_rate',
            'video_outer_play_cost',
            'video_outer_play_count',
            'video_outer_play3s_count',
            'video_outer_play5s_count',
            'video_outer_play7s_count',
            'effect_leads_purchase_cost',
            'cre_web_cost',
            'cre_app_cost',
            'pre_cre_web_cost',
            'pre_cre_app_cost',
            'store_visitor',
            'try_out_user',
            'consult_leave_info_users',
            'active_page_views',
            'active_page_viewers',
            'active_page_interaction_amount',
            'active_page_interaction_users',
            'join_chat_group_amount',
            'join_chat_group_number_of_people',
            'join_chat_group_cost_by_people',
            'guide_to_follow_page_views',
            'guide_to_follow_page_viewers',
            'guide_to_follow_page_interaction_amount',
            'guide_to_follow_page_interaction_users',
            'mini_game_register_users',
            'mini_game_register_cost',
            'mini_game_register_rate',
            'mini_game_ad_monetization_users',
            'mini_game_paying_count',
            'mini_game_paying_amount',
            'mini_game_first_paying_users',
            'mini_game_create_role_users',
            'mini_game_create_role_cost',
            'mini_game_retention_d1',
            'app_retention_d3_uv',
            'app_retention_d5_uv',
            'app_retention_d7_uv',
            'mini_game_key_page_viewers',
            'mini_game_key_page_view_cost',
            'mini_game_ad_monetization_amount',
            'mini_game_paying_amount_by_upload',
            'mini_game_paying_count_by_upload',
            'consult_leave_info_cost',
            'purchase_amount_with_coupon',
            'purchase_amount_with_coupon_cost',
            'mini_game_paying_amount_click_d1_by_upload',
            'mini_game_retention_d1_rate',
            'mini_game_retention_d1_cost',
            'app_retention_d3_cost',
            'app_retention_d5_cost',
            'app_retention_d7_cost',
            'key_page_view_rate',
            'wechat_cost_stage1',
            'wechat_cost_stage2',
            'wechat_deep_conversions_count_stage1',
            'wechat_deep_conversions_count_stage2',
            'wechat_shallow_conversions_count_stage1',
            'wechat_shallow_conversions_count_stage2',
            'activate_register_rate',
            'key_behavior_conversions_count',
            'key_behavior_conversions_cost',
            'key_behavior_conversions_rate',
            'first_day_order_roi',
            'mini_game_ad_monetization_cost',
            'mini_game_ad_monetization_roi',
            'mini_game_ad_monetization_arpu',
            'mini_game_paying_roi',
            'mini_game_paying_arpu',
            'zone_header_click_count',
            'basic_info_client_count',
            'account_info_click_count',
            'activity_info_click_count',
            'clk_redpocket_btn_get_pv',
            'clk_redpocket_btn_share_pv',
            'clk_redpocket_btn_jump_pv',
            'clk_goods_header_pv',
            'clk_goods_info_pv',
            'clk_goods_recommend_pv',
            'clk_middle_showwindow_pv',
            'clk_footer_pv',
            'clk_middle_goods_pv',
            'clk_middle_btn_pv',
            'clk_middle_section_pv',
            'clk_middle_gridview_pv',
            'mini_game_bf_uv',
            'mini_game_bf_cost',
            'mini_game_bf_income_uv',
            'mini_game_bf_income_amount',
            'mini_game_bf_income_cost',
            'mini_game_bf_income_roi',
            'mini_game_bf_income_arpu',
            'mini_game_bf_income_d1_uv',
            'mini_game_bf_income_d1_amount',
            'mini_game_bf_income_d1_cost',
            'mini_game_bf_income_d1_roi',
            'mini_game_bf_income_d1_arpu',
            'mini_game_bf_purchase_uv',
            'mini_game_bf_purchase_amount',
            'mini_game_bf_purchase_cost',
            'mini_game_bf_purchase_roi',
            'mini_game_bf_purchase_arpu',
            'mini_game_bf_purchase_d1_uv',
            'mini_game_bf_purchase_d1_amount',
            'mini_game_bf_purchase_d1_cost',
            'mini_game_bf_purchase_d1_roi',
            'mini_game_bf_purchase_d1_arpu',
            'mini_game_create_role_rate',
            'consult_uv_count',
            'video_follow_count',
            'video_heart_count',
            'video_comment_count',
            'video_live_subscribe_count',
            'video_live_exp_count',
            'video_live_heart_count',
            'video_live_comment_count',
            'video_live_share_count',
            'video_live_cick_commodity_count',
            'live_stream_exp_uv',
            'video_live_heart_user_count',
            'video_live_comment_user_count',
            'video_live_share_user_count',
            'video_live_click_commodity_user_count',
            'video_live_commodity_bubble_exp_count',
            'scan_code_add_fans_uv',
            'scan_code_add_fans_count',
            'scan_code_add_fans_uv_cost',
            'scan_code_add_fans_count_cost',
            'biz_follow_count',
            'biz_follow_uv',
            'biz_follow_cost',
            'biz_follow_rate',
            'biz_reg_count',
            'biz_reg_uv',
            'biz_reg_rate',
            'biz_reg_cost',
            'biz_reg_order_amount',
            'biz_reg_roi',
            'biz_reservation_count',
            'biz_reservation_uv',
            'biz_reservation_rate',
            'biz_reservation_cost',
            'biz_reservation_amount',
            'biz_reservation_roi',
            'biz_order_count',
            'biz_order_uv',
            'biz_order_rate',
            'biz_order_cost',
            'biz_order_roi',
            'biz_order_amount',
            'biz_1d_order_count',
            'biz_1d_order_amount',
            'biz_purchase_count',
            'biz_purchase_amount',
            'biz_purchase_roi',
            'biz_consult_count',
            'biz_reading_count',
            'biz_page_apply_count',
            'biz_page_apply_uv',
            'biz_page_apply_cost',
            'biz_page_apply_rate',
            'biz_credit_count',
            'biz_credit_cost',
            'biz_credit_rate',
            'biz_credit_uv',
            'biz_deposit_count',
            'biz_1d_purchase_count',
            'biz_1d_purchase_amount',
            'biz_3d_purchase_count',
            'biz_3d_purchase_amount',
            'biz_7d_purchase_count',
            'biz_7d_purchase_amount',
            'biz_15d_purchase_count',
            'biz_15d_purchase_amount',
            'biz_30d_purchase_count',
            'biz_30d_purchase_amount',
            'biz_1d_purchase_roi',
            'biz_3d_purchase_roi',
            'biz_7d_purchase_roi',
            'biz_15d_purchase_roi',
            'biz_30d_purchase_roi',
            'stay_pay_7d_pv',
            'stay_pay_15d_pv',
            'stay_pay_30d_pv',
            'live_stream_crt_click_cnt',
            'live_stream_avg_time',
            'live_stream_commodity_shop_bag_clk_pv',
            'live_stream_commodity_shop_list_exp_pv',
            'live_stream_commodity_bubble_clk_pv',
            'live_stream_order_pv',
            'live_stream_order_amount',
            'biz_pre_credit_pv',
            'biz_pre_credit_uv',
            'biz_pre_credit_uv_cost',
            'biz_withdraw_deposits_uv',
            'biz_withdraw_deposits_uv_cost',
            'cheout_pv_1d',
            'cheout_pv_3d',
            'cheout_pv_5d',
            'cheout_pv_7d',
            'cheout_1d_cost',
            'cheout_3d_cost',
            'cheout_5d_cost',
            'cheout_7d_cost',
            'cheout_1d_rate',
            'cheout_3d_rate',
            'cheout_5d_rate',
            'cheout_7d_rate',
            'clk_redpocket_shake_pv',
            'clk_redpocket_shake_uv',
            'reg_all_dedup_pv',
            'reg_dedup_pv',
            // 'reg_cost_pla',
            // 'reg_click_rate_pla',
        ];
    }
}
